package com.bdqn.service.impl;

import com.bdqn.Repository.UserRepository;
import com.bdqn.pojo.User;
import com.bdqn.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Resource
    public UserRepository userRepository;


    @Override
    @Cacheable(value = "user",keyGenerator = "keyGenerator")
    public User getUserById(long usrId) {
        return userRepository.findById(usrId).get();
    }
}
